import {toLine} from '~/page/FineBi/utils/convert';

export const SELECT_UNIT_ID = 'DepartmentDimensionReport_PartFive_select';
export const dIdPre = 'DepartmentDimensionReport_PartFive_select';

export const searchConfig = [
    {
        type: 'select',
        key: 'department',
        label: '学部',
        optionsConfig: {
            options: [],
            pager: {}
        },
        props: {}
    },
    {
        type: 'select',
        key: 'grade',
        label: '年级',
        optionsConfig: {
            options: [],
            pager: {}
        },
        props: {
            mode: 'multiple'
        }
    },
    {
        type: 'select',
        key: 'subjectId',
        label: '学科',
        optionsConfig: {
            options: [],
            pager: {}
        },
        props: {
            mode: 'multiple'
        }
    },
    {
        type: 'select',
        key: 'groupStatus',
        label: '新老学员',
        optionsConfig: {
            options: [],
            pager: {
            }
        },
        props: {
            mode: 'multiple'
        }
    },
    {
        type: 'select',
        key: 'teacherName',
        label: '主讲',
        optionsConfig: {
            options: [],
            pager: {}
        },
        props: {
            mode: 'multiple'
        }
    },
];

export const initialValues = {
    department: ['全部'],
    subjectId: ['全部'],
    grade: ['全部'],
    groupStatus: ['全部'],
    teacherName: ['全部']
};

export const getDefaultDimension = dId => {
    const dimension = [];
    for (const i in initialValues) {
        dimension.push({
            dimensionId: toLine(i),
            dimensionName: toLine(i),
            value: initialValues[i]
        });
    }
    return dimension;
};
